package edu.sctu.lab04;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @Author:Mrzhang
 * @Description:
 * @Date:2018.05.29 15:44
 **/
public class IndexServlet extends HttpServlet {

    /**
     * 首先进行类的编写，然后进行xml配置
     * @param req
     * @param resp
     * @throws ServletException
     * @throws IOException
     */
    @Override
    protected void doGet(HttpServletRequest req,
                         HttpServletResponse resp)
            throws ServletException, IOException {

        PrintWriter out=resp.getWriter();
        out.write("<h1>hello,servlet!</h1>");
    }
}
